<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page contentType="text/html;charset=utf-8" isELIgnored="false" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>订单</title>
		<link rel="stylesheet"href="${pageContext.request.contextPath}/css/dingdan.css"type="text/css">
	</head>
	<body>
		<table class="table-head table-mod">
			<tbody>
				<tr>
					<th width="331px">宝贝</th>
					<th>单价</th>
					<th>数量</th>
					<th>实付款</th>
					<th>交易状态</th>
				</tr>
			</tbody>
		</table>
		<c:forEach items="${orders}" var="order">
		<div class="dom">
			<label>
				<span class="time">
					<input type="checkbox"/>
					<span class="time"><fmt:formatDate value="${order.orderTime}"/></span>
				</span>
				<span>
					<span>订单号</span>
					<span>:</span>
					<span>${order.orderId}</span>
				</span>
			</label>
		</div>
		<table class="tb">
			<c:forEach items="${order.orderItems}" var="orderItem" varStatus="vs">
			<tr>
				<td width="330px">
					<div style="display: block;">
						<img src="${pageContext.request.contextPath}/productImages/${orderItem.book.productImage}" style="float: left;"/>
						<p style="width: 230px; margin-left:10px; float: left;">
							<a href="javascript::"><span class="sp">${orderItem.book.bookName}</span></a>
						</p>
					</div>
				</td>
				<td width="238px" align="center">
					<div>
						<p>${orderItem.amount}</p>
					</div>
				</td>
				<td width="238px" align="center">${orderItem.count}</td>
				<c:if test="${vs.first}">
				<td class="boder" rowspan="${order.orderItems.size()}">${order.goodPrice}</td>
				<td class="boder" width="239px" rowspan="${order.orderItems.size()}">
					<div>
						<%--未付款--%>
						<c:if test="${order.orderState==1}">
							<a href="${pageContext.request.contextPath}/ali/pay.do?orderId=${order.orderId}&amount=${order.goodPrice}">点击支付</a>
						</c:if>
						<%--已付款--%>
						<c:if test="${order.orderState==2}">
							已付款
						</c:if>
						<%--已发货--%>
						<c:if test="${order.orderState==3}">
							已发货
						</c:if>
						<%--已收货--%>
						<c:if test="${order.orderState==4}">
							已收货
						</c:if>
					</div>
				</td>
				</c:if>
			</tr>
			</c:forEach>
		</table>
		</c:forEach>
		<div style="margin: 50px;text-align: center;">
				<a href="javascript:history.go(-1);">
				<input 	class="button_1"  type="button" value="取消" /></a>  
	    </div>
	</body>
</html>